const mimeIconMap = {
  // 图片
  "image/png": "icon-tupian",
  "image/jpeg": "icon-tupian",
  "image/gif": "icon-Gif",
  "image/webp": "icon-tupian",
  "image/bmp": "icon-tupian",
  "image/svg+xml": "icon-tupian",

  // 文档
  "application/pdf": "icon-Pdf",
  "application/msword": "icon-Word",
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
    "icon-Word",
  "application/vnd.ms-excel": "icon-Excel",
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
    "icon-Excel",
  "application/vnd.ms-powerpoint": "icon-PPT",
  "application/vnd.openxmlformats-officedocument.presentationml.presentation":
    "icon-PPT",
  "text/plain": "icon-txt",
  "application/vnd.wps-office.*": "icon-WPS", // WPS 系列文档

  // 压缩包
  "application/zip": "icon-yasuobao",
  "application/x-rar-compressed": "icon-yasuobao",
  "application/x-7z-compressed": "icon-yasuobao",
  "application/x-tar": "icon-yasuobao",
  "application/gzip": "icon-yasuobao",
  "application/x-compressed": "icon-yasuobao",

  // 音频
  "audio/mpeg": "icon-music",
  "audio/wav": "icon-music",
  "audio/ogg": "icon-music",

  // 视频
  "video/mp4": "icon-shipin",
  "video/avi": "icon-shipin",
  "video/quicktime": "icon-shipin",
  "video/x-matroska": "icon-shipin",

  // 可执行文件
  "application/x-msdownload": "icon-Exe", // .exe
  "application/x-sh": "icon-chengxu", // Shell 脚本
  "application/x-bat": "icon-chengxu", // BAT 脚本

  // 数据库
  "application/x-sql": "icon-shujuku",
  "application/x-mdb": "icon-shujuku", // Access

  // 其他
  "text/html": "icon-chengxu",
  "text/css": "icon-chengxu",
  "application/json": "icon-chengxu",
  "message/rfc822": "icon-youjian", // 邮件
  "model/stl": "icon-a-3D", // 3D 模型

  // 默认
  default: "icon-weizhiwenjian",
  "inode/directory": "icon-File", // 文件夹
  folder: "icon-File", // 文件夹
};

export const getFileIconId = (mimeType, isDirectory = false) => {
  if (isDirectory) return mimeIconMap["inode/directory"];
  return mimeIconMap[mimeType] || mimeIconMap.default;
};
